<?php
// 已经废弃请勿使用
class Jf_Loader {

    public static function registerAutoload () {
        ini_set ('unserialize_callback_func', 'spl_autoload_call');
        spl_autoload_register (array(__CLASS__, 'autoload'));
    }

    static public function autoload ($class) {
        $file = dirname (dirname (__FILE__)) . DIRECTORY_SEPARATOR . strtr ($class, '_', DIRECTORY_SEPARATOR) . '.php';
        if (is_file ($file)) {
            require $file;
        }
    }

}
